#include<bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int, vector<int>,greater<int>> q;
  /** Here is how the `greater` is implemented in g++.
   * /usr/include/c++/8/bits/stl_function.h
   * /// One of the @link comparison_functors comparison functors@endlink.
   * template<typename _Tp>
   *   struct greater : public binary_function<_Tp, _Tp, bool>
   *   {
   *     _GLIBCXX14_CONSTEXPR
   *     bool
   *     operator()(const _Tp& __x, const _Tp& __y) const
   *     { return __x > __y; }
   *   };
   */
  q.push(1);
  q.push(3);
  q.push(3);  q.push(1);  q.push(-19);  q.push(5);  q.push(42);  q.push(1);
  while(!q.empty()) {
    cout << q.top() << endl;
    q.pop();
  }
  return 0;
}